home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / bibtex.tops20-changes < prev    next >
Text File  |  1988-02-11  |  4KB  |  114 lines

  1. BibTeX change file for TOPS-20, culled from Dave Fuchs's
  2. TeX change file, with his permission.
  3. Copyright (C) 1988 by Oren Patashnik.  All rights reserved.
  4.  
  5. History:
  6. January 1988---The original version of the TOPS-20 change file, for
  7.     BibTeX version 0.99a. The only substantive feature allowed
  8.     specifying the top-level .AUX file in a command line argument.
  9. February 1988---Changed for BibTeX's new version numbers, 0.99b,c.
  10.  
  11.  
  12. @x Tell WEAVE to print only the changes:
  13. \pageno=\contentspagenumber \advance\pageno by 1
  14. @y
  15. \pageno=\contentspagenumber \advance\pageno by 1
  16. \let\maybe=\iffalse
  17. \def\ttw{{\mc TOPS-20}}
  18. \def\title{\BibTeX\ changes for \ttw}
  19. @z
  20.  
  21.  
  22. @x TOPS-20's banner:
  23. @d banner=='This is BibTeX, Version 0.99c' {printed when the program starts}
  24. @y
  25. @d banner=='This is BibTeX, TOPS-20 Version 0.99c'
  26. @z
  27.  
  28.  
  29. @x    Compiler directives:
  30. @{@&$C-,A+,D-@}     {no range check, catch arithmetic overflow, no debug overhead}
  31. @!debug @{@&$C+,D+@}@+ gubed        {but turn everything on when debugging}
  32. @y    The space after the B is due to a compiler bug.
  33. @{@&$C-,A+,D-,P:520000@&B@= @>@}
  34.   {no range check, catch arithmetic overflow, no debug overhead,
  35.   move the code up to make room for the global data in production}
  36. @!debug @{@&$C+,D+,P:520000@&B@= @>@}@+ gubed
  37.   {we turn everything on when debugging}
  38. @z
  39.  
  40.  
  41. @x Define the compile-time constant |max_rescan| for command-line processing
  42. @!lit_stk_size=100; {maximum number of literal functions on the stack}
  43. @y
  44. @!lit_stk_size=100; {maximum number of literal functions on the stack}
  45. @!max_rescan=500; {maximum length of the rescan buffer}
  46. @z
  47.  
  48.  
  49. @x Set the command-line switch
  50. check_cmnd_line := false;            {many systems will change this}
  51. @y
  52. check_cmnd_line := true;
  53. @z
  54.  
  55.  
  56. @x
  57. @<Variables for possible command-line processing@>=
  58. @!check_cmnd_line : boolean;    {|true| if we're to check the command line}
  59. @y
  60.  
  61. @d RSCAN=@'500 {ReSCAN buffer JSYS}
  62.  
  63. @<Variables for possible command-line processing@>=
  64. @!check_cmnd_line : boolean;    {|true| if we're to check the command line}
  65. @!ac1: integer; {AC1 from Rescan}
  66. @!rescan: packed array[1..max_rescan] of char; {rescan buffer}
  67. @!rescan_len: integer; {amount of |rescan| used}
  68. @!i: integer; {temporary}
  69. @z
  70.  
  71.  
  72. @x And finally, here's the code that handles the command line argument.
  73. @<Process a possible command line@>=
  74. begin
  75. do_nothing;        {the ``default system'' doesn't use the command line}
  76. end
  77. @y
  78. \ttw\ puts the user command line into the so-called rescan buffer
  79. (actually, we have to use a real hack to see if it's a bogus Execute,
  80. Start, Continue, Debug, etc.\ command, in which case we should pretend
  81. there was no command line, since the command line that was there was
  82. not intended for \BibTeX).  We copy the command line into the input
  83. buffer, and once we've isolated the (\.{.aux} file-name) argument we
  84. copy that into the |name_of_file| array.
  85.  
  86. @<Process a possible command line@>=
  87. begin
  88. jsys(RSCAN,1,i;0;ac1); {put the command line into the |TTY| input buffer}
  89. if (i<>2) or (ac1<=0) then goto aux_not_found; {RSCAN failed, somehow}
  90. if eoln(term_in) then read_ln(term_in); {for some TOPS-20's}
  91. read(term_in,rescan:rescan_len); {read in rescan buffer}
  92. if rescan_len>max_rescan then begin
  93.   write_ln(term_out,'Command line longer than ',max_rescan:0,
  94.     ' characters, so I''m ignoring it');
  95.   read_ln(term_in); goto aux_not_found; end;
  96. @/{The following line is based upon experimentation with \ttw!}
  97. if rescan_len=ac1-2 then goto aux_not_found; {EX, ST, DEB commands}
  98. @#
  99. i:=1; while rescan[i]>' ' do incr(i); {skip command name, presumably BibTeX}@/
  100. while (i<=rescan_len) and (rescan[i]=' ') do incr(i); {skip spaces}@/
  101. if i>rescan_len then goto aux_not_found; {there was no argument}
  102. @#
  103. aux_name_length := 0;
  104. while (rescan[i]>' ') do        {copy the argument into |name_of_file|}
  105.     begin
  106.     if (aux_name_length = file_name_size) then
  107.     sam_you_made_the_file_name_too_long;
  108.     incr(aux_name_length);
  109.     name_of_file[aux_name_length] := rescan[i];
  110.     incr(i);
  111.     end;
  112. end
  113. @z
  114.